﻿@using Nop.Web.Framework
@{
    var nte = string.Format("nop.notifications.{0}", NotifyType.Error);
    var nts = string.Format("nop.notifications.{0}", NotifyType.Success);
    var nti = string.Format("nop.notifications.{0}", NotifyType.Info);
    var ntw = string.Format("nop.notifications.{0}", NotifyType.Warning);
}
@if (TempData[nts] != null)
{
    <div class="alert alert-success alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul>@Html.Raw(RenderList((List<string>)TempData[nts]))</ul></div>
}
@if (TempData[ntw] != null)
{
    <div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul>@Html.Raw(RenderList((List<string>)TempData[ntw]))</ul></div>
}
@if (TempData[nti] != null)
{
    <div class="alert alert-info alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul>@Html.Raw(RenderList((List<string>)TempData[nti]))</ul></div>
}
@if (TempData[nte] != null)
{
    <div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul>@Html.Raw(RenderList((List<string>)TempData[nte]))</ul></div>
}

@helper RenderList(List<string> list)
{
    if (list.Count > 0)
    { 
        foreach (var s in list)
        {
            <li>@s</li>
        }
    }
}